<extend name="Base/common" />

<block name="body">
  <form action="__SELF__" method="post" id="Z_register_form">
    <div class="control-group">
      <input type="tel" name="username" class="Z_mobile" value="" id="Z_input_username" placeholder="手机号码" errormsg="请填写正确的手机" nullmsg="请填写手机" datatype="m">
    </div>
    <if condition="C('REGISTER_MOBILE_VALID') eq 1">
      <div class="control-group">
        <input type="text" name="verify" id="verify" maxlength="4" placeholder="图形验证">
        <img class="verifyimg J_reload_verify" style="width: 86px; height: 30px; position: absolute; right: 10px; top:8px;" title="点击更换" src="{:U('verify')}">
      </div>
      <div class="control-group">
        <input type="tel" name="randcode" class="Z_mobile_randcode" maxlength="6" placeholder="短信验证">
        <a href="javascript:;" class="btn btn-primary btn-randcode Z_mobile_randcode_button">获取验证码</a>
      </div>
    </if>
    <div class="control-group">
      <input type="password"name="password" value="" id="inputPassword"  placeholder="输入密码"  errormsg="密码为6-20位" nullmsg="请输入密码" datatype="*6-20" style="padding:0 15px;">
    </div>
    <div class="control-group">
      <input type="password" name="repassword" value="" id="inputPassword" class="last" placeholder="确认密码" recheck="password" errormsg="您两次输入的密码不一致" nullmsg="请再次输入密码" datatype="*" style="padding:0 15px;">
    </div>
    <div class="control-group checkbox">
      <div class="pull-left toggle active" data-for="remember" id="register_agree">
        <div class="toggle-handle"></div>
      </div>
      同意<a href="javascript:;" id="zhuce-div">《用户注册协议》</a>
      <input type="hidden" name="remember" value="1">
    </div>
    <div class="control-action">
      <button type="submit" class="btn btn-positive btn-block" id="registerBtn">注 册</button>
      <a href="{:U('User/login')}" class="btn btn-block Z_tologin">登录已有账号</a>
    </div>
  </form>
  <!--注册协议-->
  <div id="Z_spec_info" class="modal modal-spec">
    <header class="bar bar-nav"> <a class="pull-right" href="#Z_spec_info"><i class="icon icon-close"></i></a>
      <h1 class="title">用户注册协议</h1>
    </header>
    <div class="content content-padded">
      
      <div class="pro-spc" id="Z_item_spc"> 
          <!-- 协议详情 -->
          <div class="spec-box" style="height:calc(100vh - 44px); padding:20px 0; overflow-y: auto; line-height: 2.2;">
          {$user_agreement}
            </div>

          <!-- <a id="Z_spec_submit" class="btn btn-block btn-positive">确定</a> <a href="#Z_spec_info" class="btn btn-block">取消</a> --> </div>    </div>
  </div>
</block>

<block name="script">
  <script type="text/javascript">
    seajs.use('user', function(user){
      user.getRandCode('register');
      user.zhuce();
      user.agree();
    });
  </script>
</block>
